package com.qdu.servlet;

import com.qdu.dao.UsersDao;
import com.qdu.entity.Users;
import java.io.IOException;
import java.util.ArrayList;
import static java.util.Collections.list;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.catalina.User;

/**
 *查找没有经过审核的用户
 * @author Lenovo
 */
@WebServlet("/snpus")
public class searchNotPassUserServlet extends HttpServlet{

    UsersDao userdao=new UsersDao();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //用户Service实现类
        List<Users> user=userdao.getAllUsers();//前面实现类.getAll方法
        List<Users> list=new ArrayList<>();
        for(Users u:user)//对于每一个用户
        {
            if(u.getUstatus()==0)//如果没通过审核
            {
                list.add(u);
            }
        }
        req.setAttribute("list",list);
        req.getRequestDispatcher("checkUserForm.jsp").forward(req, resp);
    }
    
    
}
